<template>
	<view class="container">
		<!-- 标题 -->
		<view class="header">
			<text class="title">我的</text>
			<text class="subtitle">系统信息与设置</text>
		</view>

		<!-- 系统信息 -->
		<view class="section">
			<text class="section-title">系统信息</text>

			<view class="info-list">
				<view class="info-item">
					<text class="info-label">系统平台</text>
					<text class="info-value">{{ systemInfo.platform }}</text>
				</view>
				<view class="info-item">
					<text class="info-label">系统版本</text>
					<text class="info-value">{{ systemInfo.system }}</text>
				</view>
				<view class="info-item">
					<text class="info-label">屏幕宽度</text>
					<text class="info-value">{{ systemInfo.screenWidth }}px</text>
				</view>
				<view class="info-item">
					<text class="info-label">屏幕高度</text>
					<text class="info-value">{{ systemInfo.screenHeight }}px</text>
				</view>
			</view>
		</view>

		<!-- 关于 -->
		<view class="about">
			<text class="about-title">uni-app 深色模式示例</text>
			<text class="about-author">作者：VK</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				systemInfo: {}
			}
		},
		onLoad() {
			this.getSystemInfo();
		},
		methods: {
			// 获取系统信息
			getSystemInfo() {
				const info = uni.getSystemInfoSync();
				this.systemInfo = {
					platform: info.platform || '未知',
					system: info.system || '未知',
					screenWidth: info.screenWidth || 0,
					screenHeight: info.screenHeight || 0
				};
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		min-height: 100vh;
		padding: 20px;
		padding-bottom: 60px;
		background-color: var(--page-bg);
	}

	.header {
		text-align: center;
		margin-bottom: 30px;
	}

	.title {
		display: block;
		font-size: 24px;
		font-weight: bold;
		color: var(--text-primary);
		margin-bottom: 10px;
	}

	.subtitle {
		display: block;
		font-size: 14px;
		color: var(--text-secondary);
	}

	.section {
		margin-bottom: 20px;
	}

	.section-title {
		display: block;
		font-size: 16px;
		font-weight: bold;
		color: var(--text-primary);
		margin-bottom: 12px;
	}

	.info-list {
		background-color: var(--card-bg);
		border-radius: 8px;
		overflow: hidden;
		box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
	}

	.info-item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 16px;
		border-bottom: 1px solid var(--border-color);
	}

	.info-item:last-child {
		border-bottom: none;
	}

	.info-label {
		font-size: 14px;
		color: var(--text-secondary);
	}

	.info-value {
		font-size: 14px;
		color: var(--text-primary);
		font-weight: 500;
	}

	.about {
		text-align: center;
		padding: 30px 10px;
	}

	.about-title {
		display: block;
		font-size: 16px;
		font-weight: bold;
		color: var(--text-primary);
		margin-bottom: 8px;
	}
	
	.about-author {
		display: block;
		font-size: 13px;
		color: var(--text-secondary);
	}
</style>